pygrub: expands tabs before displaying menus.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 23 Nov 2009 07:17:32 +0000 (07:17 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 23 Nov 2009 07:17:32 +0000 (07:17 +0000)
Otherwise the highlighting and line length trimming does not work as
expected and the display appears corrupted.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/pygrub/src/pygrub

index 84603e9c9347b25e71455257bf9a955a5ef3aa7d..1ed2606324001b9dd6ff2287625519de58e93682 100644 (file)
@@ -239,7 +239,7 @@ class Grub:
                 break
             if y == self.selected_image:
                 self.entry_win.attron(curses.A_REVERSE)
-            self.entry_win.addstr(y + 1 - self.start_image, 2, i.title.ljust(70))
+            self.entry_win.addstr(y + 1 - self.start_image, 2, i.title.expandtabs().ljust(70))
             if y == self.selected_image:
                 self.entry_win.attroff(curses.A_REVERSE)
         self.entry_win.noutrefresh()
@@ -271,7 +271,7 @@ class Grub:
                     self.entry_win.attron(curses.A_REVERSE)
 
                 # trim the line
-                l = img.lines[idx].ljust(70)
+                l = img.lines[idx].expandtabs().ljust(70)
                 if len(l) > 70:
                     l = l[:69] + ">"